package javaFeatures.src.TestFeature.oopcourse;

public class Users {
    private String account;
    private String password;
    private String email;

    public Users(String acc, String pwd, String eml) {
        this.account = acc;
        this.password = pwd;
        this.email = (eml != null && !eml.isEmpty()) ? eml : null;    }

    public Users(String acc, String pwd) {
        this(acc, pwd, null); 
    }

    public void displayInfo() {
        System.out.println("Account: " + account);
        System.out.println("Password: " + password); // 注意：在实际应用中，出于安全考虑，通常不会直接打印密码
        if (email != null) {
            System.out.println("Email: " + email);
        } else {
            System.out.println("Email: Not provided");
        }
    }

    public static void main(String[] args) {

        Users users1 = new Users("user1_account", "user1_password", "666@123.com");
        Users users2 = new Users("user2_account", "user2_password");

        System.out.println("User 1 info:");
        users1.displayInfo();

        System.out.println("\nUser 2 info:");
        users2.displayInfo();
    }
}